package com.springboot.auth.authorization.oauth2.enhancer;

import com.springboot.auth.authorization.oauth2.QrUserDetailsService;
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
import org.springframework.security.core.userdetails.UserDetailsService;

/**
 * Created by ZengJian on 2021/2/25 0025 下午 5:57
 */

public class QrAuthenticationProvider extends DaoAuthenticationProvider {
    public QrAuthenticationProvider(UserDetailsService userDetailsService) {
        super.setUserDetailsService(userDetailsService);
    }
//        public QrAuthenticationProvider(QrUserDetailsService qrUserDetailsService) {
//            super.setUserDetailsService(qrUserDetailsService);
//        }

    @Override
    public boolean supports(Class<?> authentication) {
        return QrAuthenticationToken.class.isAssignableFrom(authentication);
    }
}

